package Flap::Template::Directive::Content;
use Flap qw/-b Flap::Template::Directive -s -w/;

sub begin {
    my($dtv, $doc, $ft) = @_;
    my $_doc = @{$ft->{doc}} >= 2 && $ft->{doc}[-2];
    die qq{No directive "WRAPPER"} if !$_doc || $_doc->{body}[$_doc->{idx}]->name ne 'WRAPPER';
    $_doc = $_doc->clone;
    $_doc->{idx}++;
    push @{$ft->{doc}}, $_doc;
    $dtv->{id};
}

1;
